<?php

class ShowCalcOperations extends ShowCalc {
    private $data;

    function __construct($data) {
        $this->data = $data;
    }

    function write() {
        $txt = "<form action='".$_SERVER['PHP_SELF']."' method='post' id='operations-area'>";
        foreach ($this->data as $k => $v) {
            $txt .= <<<TXT
              <button type="submit" name="operation" value="{$k}">{$k}</button>
TXT;
        }
        $txt .= "</form>";
        return $txt;
    }
}